
<div class="page">
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li>
					<a class="add" href="demo/list/list_add.html" target="dialog"
						rel="entity_add" width="750" height="540"><span>添加</span>
					</a>
				</li>
				<li>
					<a class="delete" url="/demo/list/{list_id}"
						area="tbody.list" callback="reload" type="delete"
						target="navTabTodo" title="确定要删除选中的数据吗？" warn="请选择需要删除的数据项！"><span>删除</span>
					</a>
				</li>
			</ul>
		</div>

		<table class="list" width="98%" layoutH="54">
			<thead>
				<tr>
					<th width="3%">
						<input type="checkbox" name="objectId" value="list_id" />
					</th>
					<th width="3%">
						id
					</th>
					<th width="15%">
						列表标题
					</th>
					<th width="25%">
						容器
					</th>
					<th width="25%">
						模板
					</th>
					<th width="8%">
						对应实体
					</th>
					<th>
						描述
					</th>
					<th width="6%">
						操作
					</th>
				</tr>
			</thead>
			<tbody style="display: none;" class="templet">
				<tr list="${list_id}" put="/demo/list/${list_id}">
					<td>
						<input type="checkbox" name="list_id" value="${list_id}" />
					</td>
					<td>
						${list_id}
					</td>
					<td name="title" title="${title}" class="edit">
						${title}
					</td>
					<td name="container" title="${container}" class="edit">
						${container}
					</td>
					<td name="templet" title="${templet}" class="edit">
						${templet}
					</td>
					<td name="clazz" class="edit">
						${clazz}
					</td>
					<td name="description"  title="${description}" class="edit">
						${description}
					</td>
					<td>
						<a class="edit" href="javascript:void(0)"
							url="demo/list/list_update.html?list_id=${list_id}"
							target="dialog" warn="非法参数（${list_id}）" width="550" height="600"
							callback="updateListItem"><span>修改</span>
						</a>
						<a class="edit" name="show" warn="非法参数（${list_id}）" target="ajax"
							href="demo/list/param_list.html?list_id=${list_id}"
							rel="list${list_id}"
							callback="$this.next('a[name=hide]').show();$this.hide();$this.removeAttr('href');"><span>展开</span>
						</a>
						<a class="edit" name="hide" href="javascript:void(0);"
							style="display: none;"
							onclick="$(this).parents('tr[list=${list_id}]').next('tr[parentList=${list_id}]').hide();$(this).prev('a[name=show]').show();$(this).hide();"><span>收起</span>
						</a>
					</td>
				</tr>
				<tr parentList="${list_id}" class="hide">
						<td colspan="8" align="right" id="list${list_id}" class="shade">
							
						</td>
					</tr>
			</tbody>
			<tbody class="list" action="/demo/list">

			</tbody>
		</table>

		<div class="panelBar">
			<div class="pages"></div>
			<div class="pagination" totalCount="0" numPerPage="20" pageNumShown="10" currentPage="1"></div>
		</div>

	</div>
</div>
<script>
function updateListItem(item){
	var table=$("table.list");
	var list=$("tr[list="+item.list_id+"]",table);
	list.find("td[name=title]").text(item.title);
	list.find("td[name=container]").text(item.container);
	list.find("td[name=templet]").text(item.templet);
	list.find("td[name=demo]").text(item.demo);
	list.find("td[name=sign]").text(item.sign);
	list.find("td[name=clazz]").text(item.clazz);
	list.find("td[name=description]").text(item.description);
	alertMsg.correct("更新成功");
}
</script>
